<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app5">
      <button v-on:click="reverseString">{{msg}}</button>
      <input type="text" v-model="msg" />
    </div>

    <div id="app6">
      <button @click="n1++">+</button>
      <input v-model="n1" /> + <input v-model="n2" /> = <input v-model="sum" />
    </div>
    <script src="./js/vue3.js"></script>
    <script>
      let { createApp, ref, computed } = Vue;
      createApp({
        setup() {
          let msg = ref("Hello Vue3!!!");

          function reverseString() {
            msg.value = msg.value.split("").reverse().join("");
          }
          return { msg, reverseString };
        },
      }).mount("#app5");

      createApp({
        setup() {
          let n1 = ref(0),
            n2 = ref(0);
          let sum = computed(() => {
            return parseInt(n1.value) + parseInt(n2.value);
          });
          return { n1, n2, sum };
        },
      }).mount("#app6");
    </script>
  </body>
</html>
